home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / wildhearts_stage_dive.swf / scripts / DefineSprite_53 / frame_9 / DoAction.as
Text File  |  2011-08-19  |  1KB  |  77 lines

  1. function onEnterFrame()
  2. {
  3.    var _loc2_ = _root.getBytesLoaded() / _root.getBytesTotal();
  4.    if(getTimer() >= startTime + 100)
  5.    {
  6.       animDone = true;
  7.    }
  8.    if(Math.ceil(bar._width) >= width && animDone && !endOnce)
  9.    {
  10.       trace("loaded!");
  11.       endOnce = true;
  12.       stopSparks = true;
  13.       delete onEnterFrame;
  14.       gotoAndStop("out");
  15.       play();
  16.    }
  17.    else
  18.    {
  19.       setProgress(_loc2_);
  20.    }
  21. }
  22. function fadeOut()
  23. {
  24.    setProgress(progress);
  25.    this._alpha -= 5;
  26.    if(this._alpha <= -50)
  27.    {
  28.       this._visible = false;
  29.       _parent.play();
  30.    }
  31. }
  32. function makeSpark()
  33. {
  34. }
  35. function sparkControl()
  36. {
  37.    if(!stopSparks)
  38.    {
  39.       this._y += this.grav;
  40.       this._x += this.wind;
  41.       this.grav *= gravity;
  42.       this._alpha -= this.grav;
  43.       this._rotation += this.spin;
  44.       if(this._alpha <= 0)
  45.       {
  46.          this.removeMovieClip();
  47.       }
  48.    }
  49.    else
  50.    {
  51.       this.removeMovieClip();
  52.    }
  53. }
  54. function setProgress(p)
  55. {
  56.    bar._width = (bar._width * 2 + p * width) / 3;
  57.    if(progress != 1)
  58.    {
  59.       makeSpark();
  60.    }
  61. }
  62. width = 200;
  63. i = 0;
  64. gravity = 1.3;
  65. animDone = true;
  66. startTime = getTimer();
  67. if(this._name == "loader_mc")
  68. {
  69.    myName = _global.language.loadingAssets;
  70. }
  71. else
  72. {
  73.    myName = _global.language.initLevel;
  74. }
  75. setProgress(0);
  76. stop();
  77.